package com.lupan.mutithred.cp9_ForkJoin;

/**
 * 说明：
 *
 * @author lupan
 * @version 2017/5/25 10:43
 */
public class MainNoForkJoin {
    public static void main(String[] args) {
        long startTime = System.currentTimeMillis();
        System.out.println("开始时间："+startTime);
        System.out.println("计算结果："+sum(1, 1000000));
        long endTime = System.currentTimeMillis();
        System.out.println("结束时间："+endTime);
        System.out.println("用时："+(endTime-startTime));
    }

    private static int sum(int begin,int end){
        int sum = 0;
        for(int i=begin;i<=end;i++){
            sum += i;
        }
        return sum;
    }
}
